function pw(){
	var passwd1 = document.getElementById("Pass1").value;
	var passwd2 = document.getElementById("Pass2").value;
	if(passwd1 != passwd2)
	{
		document.getElementById("pw").innerHTML="密码不一致";}
	else{
		document.getElementById("pw").innerHTML="";}
}

function oldp(){
	var passwd1 = document.getElementById("Pass1").value;
	var passwd2 = document.getElementById("old").value;
	if(passwd1 != passwd2)
	{
		document.getElementById("oldpass").innerHTML="";}
	else{
		document.getElementById("oldpass").innerHTML="与原密码一致";}
}
function getpasswd(){ 
    var mypasswd = '<%=session.getAttribute(guest.HG_passwd")%>';
    var passwd2 = document.getElementById("old").value;
    if(passwd1 != passwd2)
	{
		document.getElementById("pass").innerHTML="";}
	else{
		document.getElementById("pass").innerHTML="与原密码一致";}
}
function passwd(){
	var passwd1 = document.getElementById("Pass1").value;
	if(passwd1.length<6||passwd1.length>15){
		document.getElementById("passwd").innerHTML="长度为6-15个字母或数字";
	}
	else{
		document.getElementById("passwd").innerHTML="";}
}
function phone(){
	 strname = document.getElementById("number").value.length;
	 if(strname < 11){
	  document.getElementById("pp").innerHTML="手机号有误";
	 }
	 else{
	  document.getElementById("pp").innerHTML="";}
}

	function IdCodeValid(){
	 var string1 = document.getElementById("Code").value;
	 const regIdCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
	    if (!regIdCard.test(string1)) {
	     document.getElementById("idcard").innerHTML="身份证输入错误";
	    } else {
	     document.getElementById("idcard").innerHTML="";
	    }
}

	function isEmail(){ 
	 var emailValue = document.getElementById("Email").value;
	 if(emailValue.indexOf("@") == -1){ 
	  document.getElementById("ex").innerHTML="邮箱有误";
	 }else{ 
	  document.getElementById("ex").innerHTML="";
	 }
}
	
function text(){
	var name = document.getElementById("name").value;
	var passwd = document.getElementById("Pass1").value;
	var phone = document.getElementById("number").value;
	var Email = document.getElementById("Email").value;
	var card = document.getElementById("Code").value;
	if(name.length==0) {
		alert("姓名不能为空");
		return false;
	}
	if(passwd.length==0){
		alert("密码不能为空");
		return false;
	}
	if(phone.length==0){
		alert("手机号不能为空");
		return false;
	}
	if(Email.length==0){
		alert("邮箱不能为空");
		return false;
	}
	if(card.length==0){
		alert("身份证不能为空");
		return false;
	}
}
function qqq(){
	var aa = document.getElementById("name").value;
	var qq = document.getElementById("Pass1").value;
	if(aa.length==0){
		alert("酒店名不能为空");
		return false;
	}
	if(qq.length==0){
		alert("密码不能为空");
		return false;
	}
	alert("请等待审核");
}



function xxx(){
	var aa = document.getElementById("qwe1").value;
	var bb = document.getElementById("asd1").value;
	if(bb <= aa) {
		alert('结束日期必须大于开始日期!');
		return false;
	}else{
		var index1=aa.indexOf("-"); 
		var index2=aa.lastIndexOf("-"); 
		var kg=aa.indexOf(" "); 
		var cha=parseInt(kg)-parseInt(index2); 
		var firstday=aa.substr(parseInt(index2)+1,cha); 
		
		var index1=bb.indexOf("-"); 
		var index2=bb.lastIndexOf("-"); 
		var kg=bb.indexOf(" "); 
		var cha=parseInt(kg)-parseInt(index2); 
		var endday=bb.substr(parseInt(index2)+1,cha);
		
		var day = endday - firstday;
		document.getElementById("qru").innerHTML = day;
		var gg = parseFloat(day);
		var hh = gg.toFixed(1) * prise
		var h1 = parseFloat(hh);
		var prise = document.getElementById("prise").innerText;
		document.getElementById("prise").innerHTML = gg.toFixed(1) * prise;
		document.getElementById("HI_prise").value = gg.toFixed(1) * prise;
	}
	
}



